<include file="Public:top" /> 
{// 引入标签库 }
<tagLib name="html" />
<style>
input{margin-bottom:10p;}
#tb1 tr{ height:35px;}
</style>
<script>
var editor;
</script>
<div id="main" class="" >
<div class="content">
<div class="title">{$vo.xmmc}小额工程信息管理  [ <a href="__URL__">返回列表</a> ]</div>
<input name="sssj1" id="sssj1" type="hidden" value="{$vo.sssj}" />
<form method="post" id="form2" name="form2">
  <table width="95%" cellpadding="3" cellspacing="3" id="tb1">
    <tr>
      <td class="tRight" >项目名称：</td>
      <td class="tLeft" ><input type="text" class="medium bLeft" name="xmmc" value="{$vo.xmmc}" /></td>
      <td class="tLeft" >备注[双击下方进入编辑状态]:</td>
    </tr>
    <tr>
      <td class="tRight" >单位名称：</td>
      <td class="tLeft" >
      	<!--<select id="cc" class="easyui-combobox" name="dwmc1"></select>--><input type="text" class="medium bLeft" id="ccc" name="ccc" value="{$vo.dwmc}" />
        <input name="dwmc" id="dwmc" type="hidden" value="{$vo.dwmc}" />
        <input name="dwid" id="dwid" type="hidden" value="{$vo.dwid}" />
      </td>
      <td rowspan="9" valign="top" class="tLeft" id="dlg_remarks"><div id="div_remarks" style="height:300px; width:570px;">{$vo.remarks}</div></td>
    </tr>
    <tr>
      <td class="tRight">资金来源：</td>
      <td class="tLeft"><select class="medium bLeft"  name="zjly" title="计划表示财政预算内资金，自筹表示未纳入财政预算的单位自筹资金">
        <option <eq name="vo.zjly" value="计划" >selected</eq> value="计划">计划</option>
        <option <eq name="vo.zjly" value="自筹" >selected</eq> value="自筹">自筹</option>
      </select></td>
    </tr>
    <tr>
      <td class="tRight" >资金年度：</td>
      <td class="tLeft" ><select class="medium bLeft"  name="zjnd" title="该资金的使用年度，以财政预算为准，自筹的以报批时间为准，一般不允许跨年度结算">
        <option <eq name="vo.zjnd" value="2007" >selected</eq> value="2007">2007</option>
        <option <eq name="vo.zjnd" value="2008" >selected</eq> value="2008">2008</option>
        <option <eq name="vo.zjnd" value="2009" >selected</eq> value="2009">2009</option>
        <option <eq name="vo.zjnd" value="2010" >selected</eq> value="2010">2010</option>
        <option <eq name="vo.zjnd" value="2011" >selected</eq> value="2011">2011</option>
        <option <eq name="vo.zjnd" value="2012" >selected</eq> value="2012">2012</option>
        <option <eq name="vo.zjnd" value="2013" >selected</eq> value="2013">2013</option>
        <option <eq name="vo.zjnd" value="2014" >selected</eq> value="2014">2014</option>
        <option <eq name="vo.zjnd" value="2015" >selected</eq> value="2015">2015</option>
        <option <eq name="vo.zjnd" value="2016" >selected</eq> value="2016">2016</option>
        <option <eq name="vo.zjnd" value="2017" >selected</eq> value="2017">2017</option>
        <option <eq name="vo.zjnd" value="2018" >selected</eq> value="2018">2018</option>
      </select></td>
    </tr>
    <tr>
      <td class="tRight" >实施时间：</td>
      <td class="tLeft" ><input type="text" id="sssj" name="sssj" class="medium bLeft" title="以工程竣工时间为准" width="150"/>
        </input></td>
    </tr>
    <tr>
      <td class="tRight" >预算金额：</td>
      <td class="tLeft" ><input type="text" class="medium bLeft"  name="ys" value="{$vo.ys}" />
        万元</td>
    </tr>
    <tr>
      <td class="tRight" >中标价格：</td>
      <td class="tLeft" ><input type="text" class="medium bLeft"  name="zbjg" value="{$vo.zbjg}" />
        万元</td>
    </tr>
    <tr>
      <td class="tRight" >中标单位：</td>
      <td class="tLeft" ><input type="text" class="medium bLeft"  name="zbdw" value="{$vo.zbdw}" /></td>
    </tr>
    <tr>
      <td class="tRight" >&nbsp;</td>
      <td class="tLeft" >&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight tTop">&nbsp;</td>
      <td class="tLeft">&nbsp;</td>
    </tr>
<!--    <tr>
      <td class="tRight">状态：</td>
      <td class="tLeft"><select class="small bLeft"  name="status">
        <option value="1">启用</option>
        <option value="0">禁用</option>
      </select></td>
      <td class="tLeft">&nbsp;</td>
    </tr>-->
    <tr>
      <td></td>
      <td class="center"><input type="hidden" name="id" value="{$vo.id}" >
        <input type="button" value="保 存" onclick="save()" class="small submit" />
        <!--<input type="reset" class="submit  small" value="清 空" />--></td>
      <td class="center">&nbsp;</td>
    </tr>
  </table>
</form>
</div>
</div>
<style>
.dlg{ height:520px; width:930px; top:2px; position:static; float:left;}
.dlg1{ height:500px; width:910px; float:left;}
</style>
<div class="hide" style="height:100%" id="hideDiv">
  	<div id="tempDiv"></div>   
</div>
<div id="popSchool" class="hide">
    <ul id="tList"><li>公办中学</li><li>公办小学</li><li>公办幼儿园</li><li>局直属单位</li></ul>
    <ul id="sList"></ul>
</div> 
<include file="Public:footer" />
<script>
jQuery(function(){
	//获取学校列表,取得项目的相关信息，作ajax处理
	$('#cc').combobox({
		url:'__URL__/showSchoolList',width:150,
		valueField:'id',
		textField:'sName',
		onSelect:function(record){  
            $('#dwid').val(record.id);   
			$('#dwmc').val(record.sName);         
        }  
	});	
	$('#cc').combobox('select',$('#dwid').val());
	
	ff='remarks';
	if($('#div_'+ff).html().length<5){
		editor = showEditor(ff,0,300);
	}else{
		jQuery('#dlg_'+ff).one('dblclick',function(){
			editor = showEditor(ff,0,300);
		})
	}
	//$('#sssj').val(getLocalTime($('#sssj1').val())).datebox(); 
	if($('#sssj1').val()){ 
		$('#sssj').val(getLocalTime($('#sssj1').val()));}
	$('#sssj').datebox(); 
	
	//显示学校列表/////////////////////////////////////////
	$.post("__URL__/showSchoolList/",0,function(data){
			for(i=0;i<data.length;i++){
				$('#sList').append("<li sID="+ data[i]['id'] +" sType="+ data[i]['sType'] +">"+data[i]['sName']+"</li>")
			}//for	
			$('#sList li').addClass("hand").hover(function(){
			  $(this).addClass("bg_green");
			},function () {
			  $(this).removeClass("bg_green");
			})//hover
			$('#sList li').click(function(){
				sType 	= $(this).attr("sType");
				sID		= $(this).attr("sID");
				sName	= $(this).text();
				$('#dwid').val(sID);   
				$('#dwmc').val(sName); 
				$('#ccc').val(sName); 
			}).hide()//click
		}//function
	,"json");//post	
		
	$('#ccc').popDiv({"targetDiv" : "popSchool"});
	$('#popSchool li').addClass("hand").hover(function(){
			$(this).addClass("bg_green");
		  },function () {
			$(this).removeClass("bg_green");
	}).click(function(){
		$('#sList li').hide();
		$("#sList li[sType='"+$(this).html()+"']").show();
	})//click
})//jquery
		
function save(){
	if(editor)$('#remarks').val(editor.html());
    var inputs = $("#form2 :input").validator({ lang: 'zh',position: 'right left',offset: [-12, 0],message: '<div><em/></div>' });//检测表单
    if(inputs.data("validator").checkValidity()){
		var queryString = $('#form2').serialize();
		$.post('__URL__/update/',queryString,function(data){
			$.messager.show({
				title:'提示信息',msg:data.info,timeout:2000,showType:'slide'
			});
		},'json')	
	}	
}
</script>